import {http} from "@/service/http";
import {MonitorInfo, RequestApiInfo, Server} from "@/types/system";

const prefix = '/Monitor'


/**
 * 获取权限部分Map数据 从库迁移到主库
 * @returns
 */
export const getMonitorInfo = () => {
  return http<MonitorInfo>({
    method: 'GET',
    url: `${prefix}/Get`,
  })
}


/**
 * getAccessApiByDate
 * @returns
 */
export const getAccessApiByDate = () => {
  return http<RequestApiInfo>({
    method: 'GET',
    url: `${prefix}/GetAccessApiByDate`,
  })
}


/**
 * getAccessApiByHour
 * @returns
 */
export const getAccessApiByHour = () => {
  return http<RequestApiInfo>({
    method: 'GET',
    url: `${prefix}/GetAccessApiByHour`,
  })
}

/**
 * getActiveUsers
 * @returns
 */
export const getActiveUsers = () => {
  return http({
    method: 'GET',
    url: `${prefix}/GetActiveUsers`,
  })
}


/**
 * getIds4Users
 * @returns
 */
export const getIds4Users = () => {
  return http<RequestApiInfo>({
    method: 'GET',
    url: `${prefix}/GetIds4Users`,
  })
}

/**
 * getRequestApiinfoByWeek
 * @returns
 */
export const getRequestApiinfoByWeek = () => {
  return http<RequestApiInfo>({
    method: 'GET',
    url: `${prefix}/GetRequestApiinfoByWeek`,
  })
}

/**
 * 获取服务器信息
 * @returns
 */
export const getServer = () => {
  return http<Server>({
    method: 'GET',
    url: `${prefix}/Server`,
  })
}

